Electronic devices having cameras are often equipped with an image sensor and one or more lenses. A lens may be moved towards or away from the image sensor to focus an object or a scene onto the image sensor. Digital cameras often include an autofocus mechanism for determining movement of a lens relative to the image sensor. Autofocus mechanisms include contrast detect autofocus and phase detect autofocus.
Contrast detection autofocus mechanisms are generally achieved by measuring contrast within a sensor field. As the intensity difference between adjacent pixels increase, the focus of the image increases. The lens may be adjusted until a maximum contrast is detected. Contrast detection uses a gradient of pixel values from the sensor's view of a scene to judge mis-focus; however, contrast detection requires repeated measurements as the lens moves and scans a focus range.
Phase detection autofocus mechanisms are generally achieved by comparing a disparity between views of a scene feature captured through a left and a right side of a lens to judge mis-focus. Phase detection autofocus systems generally include separator lenses and at least one pair of focus sensors. Although light arrives at each focus sensor in a focus sensor pair from opposite sides of a lens, the image reaching each focus sensor is the same part of the object or subject being photographed. Because of the distance between the left and right sides of the lens, each focus pixel in the focus pixel pair may see a slightly different view of a subject. To achieve focusing, the image reaching each focus pixel in the focus pixel pair is captured and compared. A phase difference between the captured images is determined and the lens may be shifted a distance corresponding to the phase difference. However, due to the finite size of focus sensor in a focus sensor pair, characteristics of a scene or object being photographed can make it difficult to arrive at a correct focus.
Like reference numerals are used in the drawings to denote like elements and features.